package com.book.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.book.entity.Cart;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

public interface CartMapper extends BaseMapper<Cart> {
    @Select("SELECT COUNT(*) AS `count`,SUM(CAST(total_price AS DECIMAL(9,1))*'count') AS totalmoney  FROM cart c WHERE c.u_id=#{uId};")
    Map<String, Object> statistics(@Param("uId") String uId);
}
